package com.排序.排序基础;

public class 冒泡排序 {

    public static void buble(int[] a){
        int j=a.length-1;
        while(true){
            int x=0;
            for(int i=0;i<j;i++){
                if(a[i]>a[i+1]){
                    int temp=a[i];
                    a[i]=a[i+1];
                    a[i+1]=temp;
                    x=i;
                }
            }
            j=x;
            if(j==0){
                break;
            }
        }
    }


    public static void main(String[] args) {
    }
}
